import React from 'react';
import axios from 'axios';
import { Alert, SafeAreaView, Text, TouchableOpacity } from 'react-native';

function onPress(){
  axios.get('https://api-vue-base.itheima.net/api/joke')
.then(function (response) {
  Alert.alert(response.data);
})
.catch(function (error) {
  console.log(error);
});
}

//发送网络请求
function App(){
  return(
    <SafeAreaView>
      <TouchableOpacity onPress={onPress}>
    <Text>发送网络请求</Text>
  </TouchableOpacity>
    </SafeAreaView>
 
  )}
export default App;
